<template>
  <div class="">
    <h6>这是子组件child</h6>
    <button @click="post">向父组件传值</button>
  </div>
</template>

<script>
export default {
  data() {
    return {
      msg: "这是子组件里的data-msg",
      msg2: "子组件的第二个要穿的数据",
    };
  },
  mounted() {},
  methods: {
    post() {
      this.$emit("aa", this.msg, this.msg2);
      //调用父组件传过来的方法aa
      //   $emit 就是用来调用自定义事件的
    },
  },
  components: {},
};
</script>

<style lang="scss"></style>
